TempStr = input ("请输入带有符号的温度值：")
if TempStr[-1] in ['F', 'f']:
    C = (eval(TempStr[0:-1]) - 32) / 1.8
    print("转换后的温度为{:.2f}F".format(C))
elif TempStr[-1] in ['C', 'c']:
    C = eval(TempStr[0:-1]) * 1.8 + 32
    print("转换后的温度为{:.2f}C".format(C))
else:
    print("格式输入错误") 